package com.example.demotool.controller;

import com.example.demotool.service.AsyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/thread")
@RestController
public class ThreadController {

    @Autowired
    private AsyncService asyncService;

    @RequestMapping("/submit")
    public String submit() {
        for (int i = 0; i < 100; i++) {
            asyncService.executeAsync();
        }
        return "success";
    }
}
